home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
Prefs.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
22KB
|
830 lines
(*************************************************************************
$RCSfile: Prefs.mod $
Description: Interface to new Preferences
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
Includes Release 40.15
(C) Copyright 1991-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A Interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
*************************************************************************)
<* STANDARD- *>
MODULE [2] Prefs;
IMPORT e := Exec, t := Timer, gfx := Graphics, i := Intuition, s := Sets;
(*
** $VER: prefhdr.h 38.1 (19.6.91)
**
** File format for preferences header
*)
(************************************************************************)
CONST
idPREF * = 050524546H; (* MAKE_ID('P','R','E','F') *)
idPRHD * = 050524844H; (* MAKE_ID('P','R','H','D') *)
TYPE
PrefHeaderPtr * = POINTER TO PrefHeader;
PrefHeader * = RECORD
version * : SHORTINT; (* version of following data *)
type * : SHORTINT; (* type of following data *)
flags * : s.SET32; (* always set to 0 for now *)
END;
(************************************************************************)
(*
** $VER: font.h 38.2 (27.9.91)
**
** File format for font preferences
*)
(************************************************************************)
CONST
idFONT * = 0464F4E54H; (* MAKE_ID('F','O','N','T') *)
fontNameSize * = 128;
TYPE
FontPrefsPtr * = POINTER TO FontPrefs;
FontPrefs * = RECORD
reserved * : ARRAY 3 OF LONGINT;
reserved2 * : e.UWORD;
type * : e.UWORD;
frontPen * : SHORTINT;
backPen * : SHORTINT;
drawMode * : SHORTINT;
textAttr * : gfx.TextAttr;
name * : ARRAY fontNameSize OF CHAR;
END;
CONST
(* constants for FontPrefs.fp_Type *)
wbFont * = 0;
sysFont * = 1;
screenFont * = 2;
(************************************************************************)
(*
** $VER: icontrol.h 39.1 (1.10.92)
**
** File format for intuition control preferences
*)
(************************************************************************)
CONST
idICTL * = 04943544CH; (* MAKE_ID('I','C','T','L') *)
TYPE
IControlPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
timeOut * : e.UWORD; (* Verify timeout *)
metaDrag * : INTEGER; (* Meta drag mouse event *)
flags * : s.SET32; (* IControl flags (see below) *)
wBtoFront * : CHAR; (* CKey: WB to front *)
frontToBack * : CHAR; (* CKey: front screen to back *)
reqTrue * : CHAR; (* CKey: Requester TRUE *)
reqFalse * : CHAR; (* CKey: Requester FALSE *)
END;
CONST
(* flags for IControlPrefs.ic_Flags *)
coerceColors * = 0;
coerceLace * = 1;
strGadFilter * = 2;
menuSnap * = 3;
modePromote * = 4;
(************************************************************************)
(*
** $VER: input.h 38.2 (28.6.91)
**
** File format for input preferences
*)
(************************************************************************)
CONST
idINPT * = 0494E5054H; (* MAKE_ID('I','N','P','T'); *)
TYPE
InputPrefsPtr * = POINTER TO InputPrefs;
InputPrefs * = RECORD
keymap * : ARRAY 16 OF CHAR;
pointerTicks * : e.UWORD;
doubleClick * : t.TimeVal;
keyRptDelay * : t.TimeVal;
keyRptSpeed * : t.TimeVal;
mouseAccel * : INTEGER;
END;
(************************************************************************)
(*
** $VER: locale.h 38.4 (5.12.91)
**
** File format for locale preferences
*)
(************************************************************************)
CONST
idLCLE * = 04C434C45H; (* MAKE_ID('L','C','L','E') *)
idCTRY * = 043545259H; (* MAKE_ID('C','T','R','Y') *)
TYPE
CountryPrefsPtr * = POINTER TO CountryPrefs;
CountryPrefs * = RECORD
reserved * : ARRAY 4 OF e.ULONG;
countryCode * : e.ULONG;
telephoneCode * : e.ULONG;
measuringSystem * : SHORTINT;
dateTimeFormat * : ARRAY 80 OF CHAR;
dateFormat * : ARRAY 40 OF CHAR;
timeFormat * : ARRAY 40 OF CHAR;
shortDateTimeFormat * : ARRAY 80 OF CHAR;
shortDateFormat * : ARRAY 40 OF CHAR;
shortTimeFormat * : ARRAY 40 OF CHAR;
(* for numeric values *)
decimalPoint * : ARRAY 10 OF CHAR;
groupSeparator * : ARRAY 10 OF CHAR;
fracGroupSeparator * : ARRAY 10 OF CHAR;
grouping * : ARRAY 10 OF SHORTINT;
fracGrouping * : ARRAY 10 OF SHORTINT;
(* for monetary values *)
monDecimalPoint * : ARRAY 10 OF CHAR;
monGroupSeparator * : ARRAY 10 OF CHAR;
monFracGroupSeparator * : ARRAY 10 OF CHAR;
monGrouping * : ARRAY 10 OF SHORTINT;
monFracGrouping * : ARRAY 10 OF SHORTINT;
monFracDigits * : SHORTINT;
monIntFracDigits * : SHORTINT;
(* for currency symbols *)
monCS * : ARRAY 10 OF CHAR;
monSmallCS * : ARRAY 10 OF CHAR;
monIntCS * : ARRAY 10 OF CHAR;
(* for positive monetary values *)
monPositiveSign * : ARRAY 10 OF CHAR;
monPositiveSpaceSep * : SHORTINT;
monPositiveSignPos * : SHORTINT;
monPositiveCSPos * : SHORTINT;
(* for negative monetary values *)
monNegativeSign * : ARRAY 10 OF CHAR;
monNegativeSpaceSep * : SHORTINT;
monNegativeSignPos * : SHORTINT;
monNegativeCSPos * : SHORTINT;
calendarType * : SHORTINT;
END;
TYPE
LocalePrefsPtr * = POINTER TO LocalePrefs;
LocalePrefs * = RECORD
reserved * : ARRAY 4 OF e.ULONG;
countryName * : ARRAY 32 OF CHAR;
preferredLanguages * : ARRAY 10,30 OF CHAR;
gmtOffset * : LONGINT;
flags * : s.SET32;
countryData * : CountryPrefs;
END;
(************************************************************************)
(*
** $VER: overscan.h 38.4 (22.10.92)
**
** File format for overscan preferences
*)
(************************************************************************)
CONST
idOSCN * = 04F53434EH; (* MAKE_ID('O','S','C','N') *)
oscanMagic * = 0FEDCBA89H;
TYPE
OverscanPrefsPtr * = POINTER TO OverscanPrefs;
OverscanPrefs * = RECORD
reserved * : e.ULONG;
magic * : e.ULONG;
hStart * : e.UWORD;
hStop * : e.UWORD;
vStart * : e.UWORD;
vStop * : e.UWORD;
displayID * : e.ULONG;
viewPos * : gfx.Point;
text * : gfx.Point;
standard * : gfx.Rectangle;
END;
(* os_HStart, os_HStop, os_VStart, os_VStop can only be looked at if
* os_Magic equals OSCAN_MAGIC. If os_Magic is set to any other value,
* these four fields are undefined
*)
(************************************************************************)
(*
** $VER: palette.h 39.2 (15.6.92)
**
** File format for palette preferences
*)
(************************************************************************)
CONST
idPALT * = 050414C54H; (* MAKE_ID('P','A','L','T') *)
TYPE
PalettePrefsPtr * = POINTER TO PalettePrefs;
PalettePrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
pap4ColorPens * : ARRAY 32 OF e.UWORD;
pap8ColorPens * : ARRAY 32 OF e.UWORD;
colors * : ARRAY 32 OF i.ColorSpec; (* Used as full 16-bit RGB values *)
END;
(************************************************************************)
(*
** $VER: pointer.h 39.2 (9.6.92)
**
** File format for pointer preferences
*)
(************************************************************************)
CONST
idPNTR * = 0504E5452H; (* MAKE_ID('P','N','T','R') *)
(************************************************************************)
TYPE
PointerPrefsPtr * = POINTER TO PointerPrefs;
PointerPrefs * = RECORD
reserved * : ARRAY 4 OF e.ULONG;
which * : e.UWORD; (* 0=NORMAL, 1=BUSY *)
size * : e.UWORD; (* see <intuition/pointerclass.h> *)
width * : e.UWORD; (* Width in pixels *)
height * : e.UWORD; (* Height in pixels *)
depth * : e.UWORD; (* Depth *)
ySize * : e.UWORD; (* YSize *)
x *, y * : e.UWORD; (* Hotspot *)
(* Color Table: numEntries = (1 << pp_Depth) - 1 *)
(* Data follows *)
END;
(************************************************************************)
CONST
(* constants for PointerPrefs.which *)
normal * = 0;
busy * = 1;
(************************************************************************)
TYPE
RGBTablePtr * = POINTER TO RGBTable;
RGBTable * = RECORD
red * : SHORTINT;
green * : SHORTINT;
blue * : SHORTINT;
END;
(************************************************************************)
(*
** $VER: printergfx.h 38.2 (3.7.91)
**
** File format for graphics printer preferences
*)
(************************************************************************)
CONST
idPGFX * = 050474658H; (* MAKE_ID('P','G','F','X') *)
TYPE
PrinterGfxPrefsPtr * = POINTER TO PrinterGfxPrefs;
PrinterGfxPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT;
aspect * : e.UWORD;
shade * : e.UWORD;
image * : e.UWORD;
threshold * : INTEGER;
colorCorrect * : SHORTINT;
dimensions * : SHORTINT;
dithering * : SHORTINT;
graphicFlags * : s.SET16;
printDensity * : SHORTINT; (* Print density 1 - 7 *)
printMaxWidth * : e.UWORD;
printMaxHeight * : e.UWORD;
printXOffset * : SHORTINT;
printYOffset * : SHORTINT;
END;
CONST
(* constants for PrinterGfxPrefs.pg_Aspect *)
horizontal * = 0;
vertical * = 1;
(* constants for PrinterGfxPrefs.pg_Shade *)
psBW * = 0;
greyScale * = 1;
color * = 2;
greyScale2 * = 3;
(* constants for PrinterGfxPrefs.pg_Image *)
positive * = 0;
negative * = 1;
(* flags for PrinterGfxPrefs.pg_ColorCorrect *)
red * = 1; (* color correct red shades *)
green * = 2; (* color correct green shades *)
blue * = 3; (* color correct blue shades *)
(* constants for PrinterGfxPrefs.pg_Dimensions *)
ignore * = 0; (* ignore max width/height settings *)
bounded * = 1; (* use max w/h as boundaries *)
absolute * = 2; (* use max w/h as absolutes *)
pixel * = 3; (* use max w/h as prt pixels *)
multiply * = 4; (* use max w/h as multipliers *)
(* constants for PrinterGfxPrefs.pg_Dithering *)
ordered * = 0; (* ordered dithering *)
halfTone * = 1; (* halftone dithering *)
floyd * = 2; (* Floyd-Steinberg dithering *)
(* flags for PrinterGfxPrefs.pg_GraphicsFlags *)
centerImage * = 0; (* center image on paper *)
integerScaling * = 1; (* force integer scaling *)
antiAlias * = 2; (* anti-alias image *)
(************************************************************************)
(*
** $VER: printerps.h 38.6 (6.5.93)
**
** File format for PostScript printer preferences
*)
(************************************************************************)
CONST
idPSPD * = 050535044H; (* MAKE_ID('P','S','P','D') *)
TYPE
PrinterPSPrefsPtr * = POINTER TO PrinterPSPrefs;
PrinterPSPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
(* Global printing attributes *)
driverMode * : SHORTINT;
paperFormat * : SHORTINT;
reserved1 * : ARRAY 2 OF e.UBYTE;
copies * : LONGINT;
paperWidth * : LONGINT;
paperHeight * : LONGINT;
horizontalDPI * : LONGINT;
verticalDPI * : LONGINT;
(* Text Options *)
font * : SHORTINT;
pitch * : SHORTINT;
orientation * : SHORTINT;
tab * : SHORTINT;
reserved2 * : ARRAY 8 OF e.UBYTE;
(* Text Dimensions *)
leftMargin * : LONGINT;
rightMargin * : LONGINT;
topMargin * : LONGINT;
bottomMargin * : LONGINT;
fontPointSize * : LONGINT;
leading * : LONGINT;
reserved3 * : ARRAY 8 OF e.UBYTE;
(* Graphics Options *)
leftEdge * : LONGINT;
topEdge * : LONGINT;
width * : LONGINT;
height * : LONGINT;
image * : SHORTINT;
shading * : SHORTINT;
dithering * : SHORTINT;
reserved4 * : ARRAY 8 OF e.UBYTE;
(* Graphics Scaling *)
aspect * : SHORTINT;
scalingType * : SHORTINT;
reserved5 * : SHORTINT;
centering * : SHORTINT;
reserved6 * : ARRAY 8 OF e.UBYTE;
END;
CONST
(* All measurements are in Millipoints which is 1/1000 of a point, or
* in other words 1/72000 of an inch
*)
(* constants for PrinterPSPrefs.ps_DriverMode *)
postScript * = 0;
passThrough * = 1;
(* constants for PrinterPSPrefs.ps_PaperFormat *)
usLetter * = 0;
usLegal * = 1;
a4 * = 2;
custom * = 3;
(* constants for PrinterPSPrefs.ps_Font *)
courier * = 0;
times * = 1;
helvetica * = 2;
helvNarrow * = 3;
avantGarde * = 4;
bookman * = 5;
newCent * = 6;
palatino * = 7;
zapfChancery * = 8;
(* constants for PrinterPSPrefs.ps_Pitch *)
pitchNormal * = 0;
pitchCompressed * = 1;
pitchExpanded * = 2;
(* constants for PrinterPSPrefs.ps_Orientation *)
portrait * = 0;
landscape * = 1;
(* constants for PrinterPSPrefs.ps_Tab *)
tab4 * = 0;
tab8 * = 1;
tabQuart * = 2;
tabHalf * = 3;
tabInch * = 4;
(* constants for PrinterPSPrefs.ps_Image *)
(* positive * = 0; *) (* same values as for printergfx *)
(* negative * = 1; *)
(* constants for PrinterPSPrefs.ps_Shading *)
shadBW * = 0;
shadGreyScale * = 1;
shadColor * = 2;
(* constants for PrinterPSPrefs.ps_Dithering *)
default * = 0;
dotty * = 1;
vert * = 2;
horiz * = 3;
diag * = 4;
(* constants for PrinterPSPrefs.ps_Aspect *)
aspHoriz * = 0;
aspVert * = 1;
(* constants for PrinterPSPrefs.ps_ScalingType *)
aspectAsis * = 0;
aspectWide * = 1;
aspectTall * = 2;
aspectBoth * = 3;
fitsWide * = 4;
fitsTall * = 5;
fitsBoth * = 6;
(* constants for PrinterPSPrefs.ps_Centering *)
centNone * = 0;
centHoriz * = 1;
centVert * = 2;
centBoth * = 3;
(************************************************************************)
(*
** $VER: printertxt.h 38.2 (1.7.91)
**
** File format for text printer preferences
*)
(************************************************************************)
CONST
idPTXT * = 050545854H; (* MAKE_ID('P','T','X','T') *)
idPUNT * = 050554E54H; (* MAKE_ID('P','U','N','T') *)
driverNameSize * = 30; (* Filename size *)
deviceNameSize * = 32; (* .device name size *)
TYPE
PrinterTxtPrefsPtr * = POINTER TO PrinterTxtPrefs;
PrinterTxtPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
driver * : ARRAY driverNameSize OF SHORTINT; (* printer driver filename *)
port * : SHORTINT; (* printer port connection *)
paperType * : e.UWORD;
paperSize * : e.UWORD;
paperLength * : e.UWORD; (* Paper length in # of lines *)
pitch * : e.UWORD;
spacing * : e.UWORD;
leftMargin * : e.UWORD; (* Left margin *)
rightMargin * : e.UWORD; (* Right margin *)
quality * : e.UWORD;
END;
CONST
(* constants for PrinterTxtPrefs.pt_Port *)
parallel * = 0;
serial * = 1;
(* constants for PrinterTxtPrefs.pt_PaperType *)
fanfold * = 0;
single * = 1;
(* constants for PrinterTxtPrefs.pt_PaperSize *)
psUSLetter * = 0;
psUSLegal * = 1;
psNTractor * = 2;
psWTractor * = 3;
psCustom * = 4;
psEuroA0 * = 5; (* European size A0: 841 x 1189 *)
psEuroA1 * = 6; (* European size A1: 594 x 841 *)
psEuroA2 * = 7; (* European size A2: 420 x 594 *)
psEuroA3 * = 8; (* European size A3: 297 x 420 *)
psEuroA4 * = 9; (* European size A4: 210 x 297 *)
psEuroA5 * = 10; (* European size A5: 148 x 210 *)
psEuroA6 * = 11; (* European size A6: 105 x 148 *)
psEuroA7 * = 12; (* European size A7: 74 x 105 *)
psEuroA8 * = 13; (* European size A8: 52 x 74 *)
(* constants for PrinterTxtPrefs.pt_PrintPitch *)
pica * = 0;
elite * = 1;
fine * = 2;
(* constants for PrinterTxtPrefs.pt_PrintSpacing *)
sixLPI * = 0;
eightLPI * = 1;
(* constants for PrinterTxtPrefs.pt_PrintQuality *)
draft * = 0;
letter * = 1;
TYPE
PrinterUnitPrefsPtr * = POINTER TO PrinterUnitPrefs;
PrinterUnitPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
unitNum * : LONGINT; (* Unit number for OpenDevice() *)
openDeviceFlags * : s.SET32; (* Flags for OpenDevice() *)
deviceName * : ARRAY deviceNameSize OF SHORTINT;
(* Name for OpenDevice() *)
END;
(************************************************************************)
(*
** $VER: screenmode.h 38.4 (25.6.92)
**
** File format for screen mode preferences
*)
(************************************************************************)
CONST
idSCRM * = 05343524DH; (* MAKE_ID('S','C','R','M') *)
TYPE
ScreenModePrefsPtr * = POINTER TO ScreenModePrefs;
ScreenModePrefs * = RECORD
reserved * : ARRAY 4 OF e.ULONG;
displayID * : e.ULONG;
width * : e.UWORD;
height * : e.UWORD;
depth * : e.UWORD;
control * : e.UWORD;
END;
CONST
(* flags for ScreenModePrefs.smp_Control *)
autoScroll * = 1;
(************************************************************************)
(*
** $VER: serial.h 38.2 (10.7.91)
**
** File format for serial preferences
*)
(************************************************************************)
CONST
idSERL * = 05345524CH; (* MAKE_ID('S','E','R','L'); *)
TYPE
SerialPrefsPtr * = POINTER TO SerialPrefs;
SerialPrefs * = RECORD
reserved * : ARRAY 3 OF LONGINT; (* System reserved *)
unit0Map * : e.ULONG; (* What unit 0 really refers to *)
baudRate * : e.ULONG; (* Baud rate *)
inputBuffer * : e.ULONG; (* Input buffer: 0 - 65536 *)
outputBuffer * : e.ULONG; (* Future: Output: 0 - 65536 *)
inputHandshake * : SHORTINT; (* Input handshaking *)
outputHandshake * : SHORTINT; (* Future: Output handshaking *)
parity * : SHORTINT; (* Parity *)
bitsPerChar * : SHORTINT; (* I/O bits per character *)
stopBits * : SHORTINT; (* Stop bits *)
END;
CONST
(* constants for SerialPrefs.sp_Parity *)
parityNone * = 0;
parityEven * = 1;
parityOdd * = 2;
parityMark * = 3; (* Future enhancement *)
paritySpace * = 4; (* Future enhancement *)
(* constants for SerialPrefs.sp_Input/OutputHandshaking *)
hshakeXON * = 0;
hshakeRTS * = 1;
hshakeNone * = 2;
(************************************************************************)
(*
** $VER: sound.h 38.2 (20.6.91)
**
** File format for sound preferences
*)
(************************************************************************)
CONST
idSOND * = 0534F4E44H; (* MAKE_ID('S','O','N','D') *)
TYPE
SoundPrefsPtr * = POINTER TO SoundPrefs;
SoundPrefs * = RECORD
reserved * : ARRAY 4 OF LONGINT; (* System reserved *)
displayQueue * : BOOLEAN; (* Flash the display? *)
audioQueue * : BOOLEAN; (* Make some sound? *)
audioType * : e.UWORD; (* Type of sound, see below *)
audioVolume * : e.UWORD; (* Volume of sound, 0..64 *)
audioPeriod * : e.UWORD; (* Period of sound, 127..2500 *)
audioDuration * : e.UWORD; (* Length of simple beep *)
audioFileName * : ARRAY 256 OF CHAR; (* Filename of 8SVX file *)
END;
CONST
(* constants for SoundPrefs.sop_AudioType *)
beep * = 0; (* simple beep sound *)
sample * = 1; (* sampled sound *)
(************************************************************************)
(*
** $VER: wbpattern.h 39.4 (11.6.92)
**
** File format for wbpattern preferences
*)
(************************************************************************)
CONST
idPTRN * = 05054524EH; (* MAKE_ID('P','T','R','N') *)
(************************************************************************)
TYPE
WBPatternPrefsPtr * = POINTER TO WBPatternPrefs;
WBPatternPrefs * = RECORD
reserved * : ARRAY 4 OF e.ULONG;
which * : e.UWORD; (* Which pattern is it *)
flags * : s.SET16;
revision * : SHORTINT; (* Must be set to zero *)
depth * : SHORTINT; (* Depth of pattern *)
dataLength * : e.UWORD; (* Length of following data *)
END;
(************************************************************************)
CONST
(* constants for WBPatternPrefs.wbp_Which *)
root * = 0;
drawer * = 1;
screen * = 2;
(* wbp_Flags values *)
pattern * = 0;
(* Data contains a pattern *)
noRemap * = 4;
(* Don't remap the pattern *)
(************************************************************************)
CONST
maxDepth * = 3; (* Max depth supported (8 colors) *)
defPatDepth * = 2; (* Depth of default patterns *)
(* Pattern width & height: *)
patWidth * = 16;
patHeight * = 16;
(************************************************************************)
END Prefs.